Skip to content

StandardApp: add selectable: false to leave out the SelectionArea - #145

Merged
rneswold merged 6 commits into
mainfrom
feat/standard-app-selectable
Oct 9, 2026
Merged

rneswold merged 6 commits into
mainfrom
feat/standard-app-selectable

Conversation

@bigsamich

Copy link
Copy Markdown
Contributor

Problem: StandardApp always wraps the app in a SelectionArea, so every Text registers as selectable. In apps whose text changes many times a second (live readings), that is extra work on every change. After a click it can also throw (on Linux: "Concurrent modification during iteration" in _ScrollableSelectionContainerDelegate.handleClearSelection, seen in bpm-hub).

Change: a selectable parameter, default true (no change for existing apps). selectable: false leaves the SelectionArea out.

Tests: two new widget tests (default has the SelectionArea, false doesn't); flutter analyze clean, flutter test 16 passed.

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

Code Coverage Report - 120 of 354 lines covered ( ⛔ 33.90%)

lib - 120 of 354 lines covered ( ⛔ 33.90%)

lib/flutter_controls_core.dart - 0 of 8 lines covered ( ⛔ 0.00%)

⛔ This file is missing coverage.

lib/src - 120 of 346 lines covered ( ⛔ 34.68%)

lib/src/app_scaffold.dart - 37 of 153 lines covered ( ⛔ 24.18%)

Uncovered lines: ⚠️ 18, 36-37, 46, 51, 56, 58, 61-62, 64, 66-67, 69, 74, 78, 80, 82, 84, 92, 94-95, 97, 99, 101, 103, 105, 107-108, 110, 114, 116-117, 122, 127-128, 130-132, 134, 136-137, 141, 149-150, 152, 154-155, 157, 166, 168-169, 175, 177-178, 181, 183-184, 187, 189, 191, 193-196, 204, 211, 216-218, 221, 224, 226, 229, 231, 242-244, 248, 250, 252-254, 256, 265-270, 278, 280, 282-283, 285-291, 293, 297-298, 300-301, 303-304, 308, 311, 325, 431, 464, 551, 557, 561, 563

lib/src/fermi_theme.dart - 0 of 66 lines covered ( ⛔ 0.00%)

⛔ This file is missing coverage.

lib/src/otel_tracing.dart - 23 of 44 lines covered ( ⛔ 52.27%)

Uncovered lines: ⚠️ 72-81, 103-104, 111, 117, 119, 194, 196, 198, 203, 205-206

lib/src/widgets - 60 of 83 lines covered ( ⛔ 72.29%)

lib/src/widgets/param_panel.dart - 11 of 12 lines covered ( ✅ 91.67%)

Uncovered lines: ⚠️ 40

lib/src/widgets/param_row.dart - 49 of 71 lines covered ( ⛔ 69.01%)

Uncovered lines: ⚠️ 69, 71-72, 76-77, 79-83, 85, 91-92, 96-97, 99-100, 122, 136-138, 146

@bigsamich
bigsamich requested review from mguzman04 and rneswold and a balanced review from Copilot October 1, 2026 18:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The backward-compatible implementation is focused, documented, and adequately tested.

Review effort: Balanced
Findings: None

What changed in this PR

Adds an opt-out for StandardApp text selection to reduce overhead for frequently updating text while preserving existing behavior by default.

Changes:

  • Adds the selectable parameter, defaulting to true.
  • Conditionally omits SelectionArea.
  • Tests both default and disabled behavior.
File Description
lib/​src/​app_scaffold.dart Adds and applies the selectable option.
test/​widget/​app_scaffold_test.dart Verifies selection wrapping behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

Code Coverage Report - 120 of 354 lines covered ( ⛔ 33.90%)

lib - 120 of 354 lines covered ( ⛔ 33.90%)

lib/flutter_controls_core.dart - 0 of 8 lines covered ( ⛔ 0.00%)

⛔ This file is missing coverage.

lib/src - 120 of 346 lines covered ( ⛔ 34.68%)

lib/src/app_scaffold.dart - 37 of 153 lines covered ( ⛔ 24.18%)

Uncovered lines: ⚠️ 18, 36-37, 46, 51, 56, 58, 61-62, 64, 66-67, 69, 74, 78, 80, 82, 84, 92, 94-95, 97, 99, 101, 103, 105, 107-108, 110, 114, 116-117, 122, 127-128, 130-132, 134, 136-137, 141, 149-150, 152, 154-155, 157, 166, 168-169, 175, 177-178, 181, 183-184, 187, 189, 191, 193-196, 204, 211, 216-218, 221, 224, 226, 229, 231, 242-244, 248, 250, 252-254, 256, 265-270, 278, 280, 282-283, 285-291, 293, 297-298, 300-301, 303-304, 308, 311, 325, 426, 459, 546, 552, 556, 558

lib/src/fermi_theme.dart - 0 of 66 lines covered ( ⛔ 0.00%)

⛔ This file is missing coverage.

lib/src/otel_tracing.dart - 23 of 44 lines covered ( ⛔ 52.27%)

Uncovered lines: ⚠️ 72-81, 103-104, 111, 117, 119, 194, 196, 198, 203, 205-206

lib/src/widgets - 60 of 83 lines covered ( ⛔ 72.29%)

lib/src/widgets/param_panel.dart - 11 of 12 lines covered ( ✅ 91.67%)

Uncovered lines: ⚠️ 40

lib/src/widgets/param_row.dart - 49 of 71 lines covered ( ⛔ 69.01%)

Uncovered lines: ⚠️ 69, 71-72, 76-77, 79-83, 85, 91-92, 96-97, 99-100, 122, 136-138, 146

@mguzman04

Copy link
Copy Markdown
Contributor

The intent of having SelectionArea at the top of the app tree, was to have the app behave similar to how other pages in a browser would behaving allowing anyone to select text. This seems to be causing more harm than good. @tooke24 and @cnlklink have also noticed this caused problems in their apps.

Perhaps it's best to remove it entirely and have individual apps handle text selection?

@rneswold

rneswold commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

I did not know that SelectionArea was that expensive. Maybe the default should be false or, like @mguzman04 said, let the app writer decide what's selectable.

@bigsamich

Copy link
Copy Markdown
Contributor Author

Thats a question for the app devs. Ill put john and dono on this as well

@cnlklink

cnlklink commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

I agree - this should be false by default but we should nudge developers to set it to true by using it in the template and commenting on it there. The alternative is that we push it into some kind of generic container that we expect developers to wrap all their relevant content in, but I think that's going to be cumbersome.

Selecting the entire app has an impact on performance. We shut it off, by default. A developer can choose to enable it for their app.
Updated tests to reflect changes in SelectionArea behavior based on selectable property.
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

Code Coverage Report - 120 of 354 lines covered ( ⛔ 33.90%)

lib - 120 of 354 lines covered ( ⛔ 33.90%)

lib/flutter_controls_core.dart - 0 of 8 lines covered ( ⛔ 0.00%)

⛔ This file is missing coverage.

lib/src - 120 of 346 lines covered ( ⛔ 34.68%)

lib/src/app_scaffold.dart - 37 of 153 lines covered ( ⛔ 24.18%)

Uncovered lines: ⚠️ 18, 36-37, 46, 51, 56, 58, 61-62, 64, 66-67, 69, 74, 78, 80, 82, 84, 92, 94-95, 97, 99, 101, 103, 105, 107-108, 110, 114, 116-117, 122, 127-128, 130-132, 134, 136-137, 141, 149-150, 152, 154-155, 157, 166, 168-169, 175, 177-178, 181, 183-184, 187, 189, 191, 193-196, 204, 211, 216-218, 221, 224, 226, 229, 231, 242-244, 248, 250, 252-254, 256, 265-270, 278, 280, 282-283, 285-291, 293, 297-298, 300-301, 303-304, 308, 311, 325, 426, 459, 546, 552, 556, 558

lib/src/fermi_theme.dart - 0 of 66 lines covered ( ⛔ 0.00%)

⛔ This file is missing coverage.

lib/src/otel_tracing.dart - 23 of 44 lines covered ( ⛔ 52.27%)

Uncovered lines: ⚠️ 72-81, 103-104, 111, 117, 119, 194, 196, 198, 203, 205-206

lib/src/widgets - 60 of 83 lines covered ( ⛔ 72.29%)

lib/src/widgets/param_panel.dart - 11 of 12 lines covered ( ✅ 91.67%)

Uncovered lines: ⚠️ 40

lib/src/widgets/param_row.dart - 49 of 71 lines covered ( ⛔ 69.01%)

Uncovered lines: ⚠️ 69, 71-72, 76-77, 79-83, 85, 91-92, 96-97, 99-100, 122, 136-138, 146

Bump version number so dependents can use SemVer to update.
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

Code Coverage Report - 120 of 354 lines covered ( ⛔ 33.90%)

lib - 120 of 354 lines covered ( ⛔ 33.90%)

lib/flutter_controls_core.dart - 0 of 8 lines covered ( ⛔ 0.00%)

⛔ This file is missing coverage.

lib/src - 120 of 346 lines covered ( ⛔ 34.68%)

lib/src/app_scaffold.dart - 37 of 153 lines covered ( ⛔ 24.18%)

Uncovered lines: ⚠️ 18, 36-37, 46, 51, 56, 58, 61-62, 64, 66-67, 69, 74, 78, 80, 82, 84, 92, 94-95, 97, 99, 101, 103, 105, 107-108, 110, 114, 116-117, 122, 127-128, 130-132, 134, 136-137, 141, 149-150, 152, 154-155, 157, 166, 168-169, 175, 177-178, 181, 183-184, 187, 189, 191, 193-196, 204, 211, 216-218, 221, 224, 226, 229, 231, 242-244, 248, 250, 252-254, 256, 265-270, 278, 280, 282-283, 285-291, 293, 297-298, 300-301, 303-304, 308, 311, 325, 426, 459, 546, 552, 556, 558

lib/src/fermi_theme.dart - 0 of 66 lines covered ( ⛔ 0.00%)

⛔ This file is missing coverage.

lib/src/otel_tracing.dart - 23 of 44 lines covered ( ⛔ 52.27%)

Uncovered lines: ⚠️ 72-81, 103-104, 111, 117, 119, 194, 196, 198, 203, 205-206

lib/src/widgets - 60 of 83 lines covered ( ⛔ 72.29%)

lib/src/widgets/param_panel.dart - 11 of 12 lines covered ( ✅ 91.67%)

Uncovered lines: ⚠️ 40

lib/src/widgets/param_row.dart - 49 of 71 lines covered ( ⛔ 69.01%)

Uncovered lines: ⚠️ 69, 71-72, 76-77, 79-83, 85, 91-92, 96-97, 99-100, 122, 136-138, 146

Update the docs to use the SemVer-compatible syntax in `pubspec.yaml`.
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

Code Coverage Report - 120 of 354 lines covered ( ⛔ 33.90%)

lib - 120 of 354 lines covered ( ⛔ 33.90%)

lib/flutter_controls_core.dart - 0 of 8 lines covered ( ⛔ 0.00%)

⛔ This file is missing coverage.

lib/src - 120 of 346 lines covered ( ⛔ 34.68%)

lib/src/app_scaffold.dart - 37 of 153 lines covered ( ⛔ 24.18%)

Uncovered lines: ⚠️ 18, 36-37, 46, 51, 56, 58, 61-62, 64, 66-67, 69, 74, 78, 80, 82, 84, 92, 94-95, 97, 99, 101, 103, 105, 107-108, 110, 114, 116-117, 122, 127-128, 130-132, 134, 136-137, 141, 149-150, 152, 154-155, 157, 166, 168-169, 175, 177-178, 181, 183-184, 187, 189, 191, 193-196, 204, 211, 216-218, 221, 224, 226, 229, 231, 242-244, 248, 250, 252-254, 256, 265-270, 278, 280, 282-283, 285-291, 293, 297-298, 300-301, 303-304, 308, 311, 325, 426, 459, 546, 552, 556, 558

lib/src/fermi_theme.dart - 0 of 66 lines covered ( ⛔ 0.00%)

⛔ This file is missing coverage.

lib/src/otel_tracing.dart - 23 of 44 lines covered ( ⛔ 52.27%)

Uncovered lines: ⚠️ 72-81, 103-104, 111, 117, 119, 194, 196, 198, 203, 205-206

lib/src/widgets - 60 of 83 lines covered ( ⛔ 72.29%)

lib/src/widgets/param_panel.dart - 11 of 12 lines covered ( ✅ 91.67%)

Uncovered lines: ⚠️ 40

lib/src/widgets/param_row.dart - 49 of 71 lines covered ( ⛔ 69.01%)

Uncovered lines: ⚠️ 69, 71-72, 76-77, 79-83, 85, 91-92, 96-97, 99-100, 122, 136-138, 146

@rneswold
rneswold merged commit aeda8bc into main Oct 9, 2026
2 checks passed
@rneswold
rneswold deleted the feat/standard-app-selectable branch October 9, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants